﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Business;

namespace TimKiemDiaDiem
{
    public class TimKiemDonGianCtrl : LoaiTimKiemCtrl
    {
        public TimKiemDonGianCtrl()
        {
            lblDichVu.Visible = false;
            cbbDichVu.Visible = false;
            lblDuong.Visible = false;
            cbbTenDuong.Visible = false;
        }


        public override bool KiemTraDieuKienTraCuu()
        {
            if ("" == txtTuKhoa.Text && "TatCa" == m_TenDichVu)
            {
                return false;
            }
            return true;
        }

        public override List<DiaDiemDTO> TraCuuDiaDiem()
        {
            List<DiaDiemDTO> KetQua = new List<DiaDiemDTO>();

            if ("TatCa" != m_TenDichVu)
            {
                KetQua = XL_DiaDiem.tracuuDiaDiem(m_TenDichVu, txtTuKhoa.Text);
            }
            else
            {
                KetQua = XL_DiaDiem.tracuuDiaDiem(txtTuKhoa.Text);
            }

            return KetQua;
        }

        protected override void TimKiemCtrl_Load(object sender, EventArgs e)
        {
            base.TimKiemCtrl_Load(sender, e);
        }
    }
}
